package com.djmw.mouse.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

@Embeddable
public class ApplicationId implements Serializable {
    private static final long serialVersionUID = -2968285004307010080L;

    private Position position;
    private CvLang cvLang;
    private MemberUser memberUser;

    @ManyToOne
    public Position getPosition() {
        return position;
    }
    public void setPosition(Position position) {
        this.position = position;
    }

    @ManyToOne
    public CvLang getCvLang() {
        return cvLang;
    }
    public void setCvLang(CvLang cvLang) {
        this.cvLang = cvLang;
    }

    @ManyToOne
    public MemberUser getMemberUser() {
        return memberUser;
    }
    public void setMemberUser(MemberUser memberUser) {
        this.memberUser = memberUser;
    }

    @Override
    public int hashCode() {
        int result = (position != null ? position.hashCode() : 0);
        result = 31 * result + (cvLang != null ? cvLang.hashCode() : 0);
        result = 31 * result + (memberUser != null ? memberUser.hashCode() : 0);
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        ApplicationId app = (ApplicationId) obj;
        if (position != null ? !position.equals(app.position) : app.position != null) {
            return false;
        }
        if (cvLang != null ? !cvLang.equals(app.cvLang) : app.cvLang != null) {
            return false;
        }
        return true;
    }

}
